Skip to content

fix: always show alerting for anon users#5625

Open
fabio-silva wants to merge 5 commits into
mainfrom
PMM-15067-anon-alerting
Open

fix: always show alerting for anon users#5625
fabio-silva wants to merge 5 commits into
mainfrom
PMM-15067-anon-alerting

Conversation

@fabio-silva

Copy link
Copy Markdown
Contributor

Ticket number: PMM-15067

  • Anonymous users should see Grafana alerting, as it should be seen by Viewers

@fabio-silva
fabio-silva requested a review from a team as a code owner July 9, 2026 10:53
@fabio-silva
fabio-silva requested review from matejkubinec and mattiasimonato and removed request for a team July 9, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the PMM UI sidebar navigation logic to make Grafana Alerting visible for anonymous users (treating them more like Viewer users), and adjusts some navigation items to better reflect authentication state.

Changes:

  • Refactors addAlerting to take separate alertingEnabled and unifiedAlertingEnabled flags and conditionally include certain sub-items.
  • Updates NavigationProvider to render more of the navigation tree for anonymous users while hiding the Account menu unless the user is actually logged in.
  • Adds useAuth() usage to distinguish “has a user object” vs “is logged in”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ui/apps/pmm/src/contexts/navigation/navigation.utils.tsx Refactors alerting nav item construction to incorporate unified alerting state.
ui/apps/pmm/src/contexts/navigation/navigation.provider.tsx Adjusts sidebar item inclusion based on user, settings, and isLoggedIn to support anonymous visibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to +85
items.push(
addAlerting(
settings?.alertingEnabled,
settings?.frontend.unifiedAlertingEnabled,
user
Comment on lines 143 to 147
children.push(NAV_ALERTS_RULES);
children.push(NAV_ALERTS_CONTACT_POINTS);
children.push(NAV_ALERTS_NOTIFICATION_POLICIES);
children.push(NAV_ALERTS_SILENCES);
children.push(NAV_ALERTS_GROUPS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants